<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>18.栅格区域布局真的太好用了</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    article {
      display: grid;
      width: 100vw;
      height: 100vh;
      grid-template-rows: 60px 1fr 60px;
      grid-template-columns: 60px 1fr;
      /*定义区域 我们只想把最底部两个单元格合并*/
      grid-template-areas: "header header"
        "main main"
        "footer footer";
    }


    nav,
    footer {
      background-color: blueviolet;
      background-clip: content-box;
      padding: 10px;
    }

    header {
      grid-area: header;
      background: #333;
    }

    main {
      grid-area: main;
      background: blue;
    }

    footer {
      grid-area: footer;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
    }

    footer div {
      background-color: silver;
      background-clip: content-box;
      padding: 10px;
    }
  </style>
</head>

<body>
  <article>
    <header>...</header>
    <main></main>

    <footer>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </footer>
  </article>
</body>

</html> 